---
title: Load provider tax IDs
summary: Loads all tax-ID registrations for a provider, including each tax ID's embedded address.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-08-21
library: SAIF.Business.View.Provider
reference_type: embedded
operation_id: OP-08
trigger: clsProvider.TaxIDs navigation; clsProvider.PayeeAddress resolution
---

# Load provider tax IDs

Loads all tax-ID registrations for a provider, each including an embedded address, and supports payee-address resolution based on the tax ID effective today.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-08 |
| **Trigger** | `clsProvider.TaxIDs`; `clsProvider.PayeeAddress` |
| **Inputs** | `IDataPortalInfo`, provider sequence number |
| **Outputs** | `clsProviderTaxIDCollection` |
| **Primary components** | `clsProviderTaxIDCollection.GetProviderTaxIDs` |
| **Entry point** | `SAIF.Business.View.Provider/clsProviderTaxIDCollection.vb:115` |

## Steps

1. `Criteria` inherits `clsRetrieveOnlyBusinessCriteria` and installs its SQL via `SetRetrieveSQL(...)` ([SQL-PTAX-01](../sql/SQL-PTAX-01-provider-tax-ids.md) against [PROVIDER_TAX_ID](../database-tables.md#provider_tax_id)).
2. `BeforeRetrieve` sets `RequestType = DataRequestType.ResultSet`, `ID = "Retrieve Provider TaxID's"`, and binds `:ProviderSeqNum`.
3. `AfterRetrieve` iterates `clsResultSet.DataRow` rows, `Load()`-ing a `clsProviderTaxID` each; `Fill` also populates an embedded `clsAddress` (formatting suspended via `ActiveFormating = False` while the parts are set, then re-enabled).
4. Consumed by `clsProvider.TaxIDs` and by `clsProvider.PayeeAddress`, which selects the tax-ID record effective today and not yet expired whose tax ID equals the primary location's provider primary tax ID, falling back to the primary location's active payment address if none is found ([BR-PRV-002](../business-rules.md#br-prv-002-payee-address-resolution-order)).
   - If no tax-ID record matches: `TaxIDs.First(...)` throws when no element matches, so the payment-address fallback branch may be unreachable in practice.**

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start([Caller request]) --> S1["BeforeRetrieve binds<br>ProviderSeqNum"]
	S1 --> S2["AfterRetrieve: iterate<br>ResultSet rows"]
	S2 --> S3[Load each row into clsProviderTaxID<br>with embedded clsAddress]
	S3 --> S4{PayeeAddress requested?}
	S4 -->|Yes| S5["Find tax ID effective today,<br>not expired"]
	S4 -->|No| EndOk(["clsProviderTaxIDCollection<br>returned"])
	S5 --> S6{Match found?}
	S6 -->|Yes| S7([Tax-ID address returned])
	S6 -->|No| S8(["Fallback to primary<br>location's active payment<br>address"])
	S7 --> EndOk
	S8 --> EndOk
```

## Failure and edge-case behavior

- No tax-ID rows for a provider: an empty `clsProviderTaxIDCollection` is returned.
- `clsProvider.PayeeAddress` calls `TaxIDs.First(...)`, which throws when no element matches; whether the payment-address fallback branch is ever reached is unknown.**

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [SQL catalog](../sql/index.md)
- [Database tables](../database-tables.md)

> **Note:** Statements marked with * were inferred from code structure, naming conventions, or
> contextual evidence where direct confirmation was not available in source artifacts. Statements
> marked with ** could not be confirmed; treat as unknown until verified.

## Sources
- `SAIF.Business.View.Provider/clsProviderTaxIDCollection.vb`
- `SAIF.Business.View.Provider/clsProvider.vb`
